enum Com_Btns {
    Button1 = "连接",
    Button2 = "断开",
    Button3 = "进入测试模式",
    Button4 = "退出测试模式",
}

const Com_Map: { [key: string]: { name: string, key: string, click: any } } = {
    [Com_Btns.Button1]: { name: "连接", key: 'c1', click: () => '失败' },
    [Com_Btns.Button2]: { name: "断开", key: 'c2', click: () => '失败' },
    [Com_Btns.Button3]: { name: "进入测试模式", key: 'c3', click: () => { } },
    [Com_Btns.Button4]: { name: "退出测试模式", key: 'c4', click: () => { } },
}
const List1 = (() => {
    let arr: { label: string, value: string }[] = [];
    for (let i = 1; i < 10; i++) {
        arr.push({ label: `com${i}`, value: `${i}` })
    }
    return arr;
})()

enum Key_Btns {
    Button1 = "重置锁芯",
    Button2 = "更改密码",
    Button3 = "开锁",
    Button4 = "查看锁芯版本",
    Button5 = "设置锁芯ID",
    Button6 = "设置部门ID",
    Button7 = "获取锁芯和部门ID",
}

const Key_Map: { [key: string]: { name: string, key: string, click: any } } = {
    [Key_Btns.Button1]: { name: "重置锁芯", key: 'key1', click: () => { } },
    [Key_Btns.Button2]: { name: "更改密码", key: 'key2', click: () => { } },
    [Key_Btns.Button3]: { name: "开锁", key: 'key3', click: () => { } },
    [Key_Btns.Button4]: { name: "查看锁芯版本", key: 'key4', click: (fn) => {fn()} },
    [Key_Btns.Button5]: { name: "设置锁芯ID", key: 'key5', click: () => { } },
    [Key_Btns.Button6]: { name: "设置部门ID", key: 'key6', click: () => { } },
    [Key_Btns.Button7]: { name: "获取锁芯和部门ID", key: 'key7', click: () => { } }
}


enum Lock_Btns {
    Button1 = "设备名称",
    Button2 = "获取电量",
    Button3 = "同步时间",
    Button4 = "获取时间",
    Button5 = "设置延时",
    Button6 = "获取延时",
    Button7 = "查看钥匙信息",
    Button8 = "下发任务编号和密钥",
    Button9 = "获取任务编号",
    Button10 = "设置时间段",
    Button11 = "获取时间段",
    Button12 = "下发锁芯ID",
    Button13 = "获取锁芯ID",
    Button14 = "删除下发锁芯ID",
    Button15 = "清空存下发芯ID",
    Button16 = "获取开锁记录",
    Button17 = "清空开锁记录",
}

const Lock_Map: { [key: string]: { name: string, key: string, click: any } } = {
    [Lock_Btns.Button1]: { name: "设备名称", key: "key1", click: () => { } },
    [Lock_Btns.Button2]: { name: "获取电量", key: "key2", click: () => { } },
    [Lock_Btns.Button3]: { name: "同步时间", key: "key3", click: () => { } },
    [Lock_Btns.Button4]: { name: "获取时间", key: "key4", click: () => { } },
    [Lock_Btns.Button5]: { name: "设置延时", key: "key5", click: () => { } },
    [Lock_Btns.Button6]: { name: "获取延时", key: "key6", click: () => { } },
    [Lock_Btns.Button7]: { name: "查看钥匙信息", key: "key7", click: () => { } },
    [Lock_Btns.Button8]: { name: "下发任务编号和密钥", key: "key8", click: () => { } },
    [Lock_Btns.Button9]: { name: "获取任务编号", key: "key9", click: () => { } },
    [Lock_Btns.Button10]: { name: "设置时间段", key: "key10", click: () => { } },
    [Lock_Btns.Button11]: { name: "获取时间段", key: "key11", click: () => { } },
    [Lock_Btns.Button12]: { name: "下发锁芯ID", key: "key12", click: () => { } },
    [Lock_Btns.Button13]: { name: "获取锁芯ID", key: "key13", click: () => { } },
    [Lock_Btns.Button14]: { name: "删除下发锁芯ID", key: "key14", click: () => { } },
    [Lock_Btns.Button15]: { name: "清空存下发芯ID", key: "key15", click: () => { } },
    [Lock_Btns.Button16]: { name: "获取开锁记录", key: "key16", click: () => { } },
    [Lock_Btns.Button17]: { name: "清空开锁记录", key: "key17", click: () => { } },


}


// 列定义
const columns = [
    {
      title: '操作人员',
      dataIndex: 'operator',
      key: 'operator',
    },
    {
      title: '操作内容',
      dataIndex: 'operation',
      key: 'operation',
    },
    {
      title: '操作结果',
      dataIndex: 'result',
      key: 'result',
    },
    {
      title: '操作时间',
      dataIndex: 'time',
      key: 'time',
    },
  ];

export { Com_Map, Com_Btns, List1, Key_Btns, Key_Map, Lock_Btns, Lock_Map,columns }
